#include <iostream>

using namespace std;
using LL = long long;
const int N = 2e5 + 10;

int n;
LL q[N];
LL d[N];
LL t[2];

int main(){
    // ios::sync_with_stdio(false);
    // cin.tie(0);
    // cout.tie(0);
    cin >> n;
    for(int i = 1; i <= n; i ++){
        cin >> q[i];
    }
    d[1] = q[1];
    for(int i = 2; i <= n; i ++){
        d[i] = q[i] - q[i - 1];
    }
    
    for(int i = 2; i <= n; i ++){
        if(d[i] > 0) t[1] += d[i];
        else t[0] -= d[i];
    }
    //cout << t[0] << " " << t[1] << '\n';
    LL k = abs(t[0] - t[1]);
    cout << max(t[0], t[1]) << '\n' << k + 1 << '\n';
    
    return 0;
}

